﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ServerApplication.Communication
{
    class HelperFunctions
    {
        public static void StartGateKeeperProcess()
        {
            //get Bat File name from app.config
            string fileName = ConfigurationManager.AppSettings["GateKeeper"].ToString();
            string currentDirectory = Directory.GetCurrentDirectory();
            string workingDir = "./";
            System.Diagnostics.Process batchProc = new System.Diagnostics.Process
            {
                //Setting up 
                StartInfo =
                {
                    FileName = fileName,
                    WorkingDirectory = currentDirectory
                }
            };

            batchProc.Start();
            Console.WriteLine("Batch process started");
        }
    }
}
